package com.cjm.one.goods.admin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.goods.service.CustomerCouponService;
import com.cjm.one.model.coupon.entity.CustomerCoupon;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@Tag(name = "4-客户领取优惠券记录", description = "客户优惠券")
@RequestMapping("/admin/customer/coupon")
public class CustomerCouponController
{
    @Resource
    private CustomerCouponService customerCouponService;
    @GetMapping("/list")
    @Operation(summary = "客户领取优惠券记录列表")
    public Result<Page<CustomerCoupon>> list(@RequestParam(defaultValue = "1") Integer current,
                                           @RequestParam(defaultValue = "10") Integer size,
                                           @RequestParam(name = "keyword",required = false) String keyword,
                                            @RequestParam(name = "status",required = false) Integer status,
                                             @RequestParam(name = "userId",required = false) Long userId) {
        return Result.ok(customerCouponService.listPage(current,size,keyword,status,userId));
    }

}
